{%  extends "blog-base.html" %}

{% block main_content %}
{% for blog in blogs %}
<div class="blog">
    <div class="title">
        <h3><a href="/blog/id/{{ blog.blog_id }}">{{ blog.title }}</a></h3>
    </div>
    <div class="desc">
        <ul>
            <li class="date">{{ blog.pub_time|default:"未知" }}</li>
            <li>{{ blog.author|default:"未知" }}</li>
        </ul>
        <p>{{ blog.comment_count }}条评论</p>
    </div>
    <div class="post">
      {{ blog.content|safe }}
    </div>
</div>
{% endfor %}
<div class="pagination">
  <span class="step-links">
    {% if blogs.has_previous %}
    <a href="/blog/{{ blogs.previous_page_number }}">上一页</a>
    {% endif %}
    <span>
      Page: {{ blogs.number }} of {{ blogs.paginator.num_pages }}
    </span>
    {% if blogs.has_next %}
    <a href="/blog/{{ blogs.next_page_number }}">下一页</a>
    {% endif %}
  </span>
</div>
{% endblock %}
